package(
    default_visibility = ["//visibility:public"],
    licenses = ["notice"],
)

cc_library(
    name = "single_machine_factory_scann",
    srcs = ["single_machine_factory_scann.cc"],
    hdrs = ["single_machine_factory_scann.h"],
    tags = ["local"],
    deps = [
        ":reordering_helper_factory",
        ":single_machine_base",
        ":single_machine_factory_options",
        "//scann/base/internal:single_machine_factory_impl",
        "//scann/base/internal:tree_x_hybrid_factory",
        "//scann/brute_force",
        "//scann/brute_force:bfloat16_brute_force",
        "//scann/brute_force:scalar_quantized_brute_force",
        "//scann/data_format:dataset",
        "//scann/distance_measures",
        "//scann/oss_wrappers:scann_aligned_malloc",
        "//scann/oss_wrappers:scann_down_cast",
        "//scann/oss_wrappers:scann_status",
        "//scann/oss_wrappers:scann_threadpool",
        "//scann/oss_wrappers:tf_dependency",
        "//scann/partitioning:kmeans_tree_like_partitioner",
        "//scann/partitioning:kmeans_tree_partitioner",
        "//scann/partitioning:partitioner_base",
        "//scann/partitioning:partitioner_factory",
        "//scann/partitioning:partitioner_factory_base",
        "//scann/partitioning:projecting_decorator",
        "//scann/proto:brute_force_cc_proto",
        "//scann/proto:distance_measure_cc_proto",
        "//scann/proto:exact_reordering_cc_proto",
        "//scann/proto:scann_cc_proto",
        "//scann/tree_x_hybrid:mutator",
        "//scann/tree_x_hybrid:tree_ah_hybrid_residual",
        "//scann/tree_x_hybrid:tree_x_hybrid_smmd",
        "//scann/utils:common",
        "//scann/utils:factory_helpers",
        "//scann/utils:hash_leaf_helpers",
        "//scann/utils:scalar_quantization_helpers",
        "//scann/utils:types",
        "@com_google_absl//absl/base",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/memory",
    ],
)

cc_library(
    name = "reordering_helper_factory",
    srcs = ["reordering_helper_factory.cc"],
    hdrs = ["reordering_helper_factory.h"],
    tags = ["local"],
    deps = [
        ":single_machine_factory_options",
        "//scann/data_format:dataset",
        "//scann/hashes/asymmetric_hashing2:training_model",
        "//scann/oss_wrappers:scann_aligned_malloc",
        "//scann/oss_wrappers:scann_down_cast",
        "//scann/oss_wrappers:tf_dependency",
        "//scann/projection:projection_factory",
        "//scann/proto:distance_measure_cc_proto",
        "//scann/proto:exact_reordering_cc_proto",
        "//scann/utils:factory_helpers",
        "//scann/utils:reordering_helper",
        "//scann/utils:types",
        "@com_google_absl//absl/base",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/log",
    ],
)

cc_library(
    name = "single_machine_factory_options",
    srcs = ["single_machine_factory_options.cc"],
    hdrs = ["single_machine_factory_options.h"],
    tags = ["local"],
    deps = [
        "//scann/data_format:dataset",
        "//scann/oss_wrappers:scann_threadpool",
        "//scann/partitioning:partitioner_cc_proto",
        "//scann/proto:centers_cc_proto",
        "//scann/proto:hash_cc_proto",
        "//scann/utils:common",
        "//scann/utils:input_data_utils",
        "//scann/utils:types",
        "//scann/utils/fixed_point:pre_quantized_fixed_point",
    ],
)

cc_library(
    name = "single_machine_base",
    srcs = [
        "single_machine_base.cc",
        "single_machine_base_mutator.cc",
    ],
    hdrs = ["single_machine_base.h"],
    tags = ["local"],
    deps = [
        ":search_parameters",
        ":single_machine_factory_options",
        "//scann/data_format:datapoint",
        "//scann/data_format:dataset",
        "//scann/data_format:docid_collection_interface",
        "//scann/distance_measures:distance_measure_base",
        "//scann/metadata:metadata_getter",
        "//scann/oss_wrappers:scann_aligned_malloc",
        "//scann/oss_wrappers:scann_down_cast",
        "//scann/oss_wrappers:scann_status",
        "//scann/oss_wrappers:scann_threadpool",
        "//scann/oss_wrappers:tf_dependency",
        "//scann/proto:results_cc_proto",
        "//scann/proto:scann_cc_proto",
        "//scann/utils:common",
        "//scann/utils:factory_helpers",
        "//scann/utils:fast_top_neighbors",
        "//scann/utils:reordering_helper_interface",
        "//scann/utils:types",
        "//scann/utils:util_functions",
        "//scann/utils:zip_sort",
        "@com_google_absl//absl/base",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/synchronization",
    ],
)

cc_library(
    name = "search_parameters",
    srcs = ["search_parameters.cc"],
    hdrs = ["search_parameters.h"],
    tags = ["local"],
    deps = [
        ":restrict_allowlist",
        "//scann/data_format:features_cc_proto",
        "//scann/oss_wrappers:scann_aligned_malloc",
        "//scann/oss_wrappers:tf_dependency",
        "//scann/utils:common",
        "//scann/utils:types",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    # Backcompat shim
    name = "restrict_allowlist",
    hdrs = ["restrict_allowlist.h"],
    tags = ["local"],
    deps = [
        "//scann/restricts:restrict_allowlist",
    ],
)
